import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysBuryingPoint = (params) => {
  params.head.transCode = 'querySysBuryingPoint';
  return request({
    url: '/platform/sysBuryingPoint/querySysBuryingPoint',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysBuryingPointListPage = (params) => {
  params.head.transCode = 'querySysBuryingPointListPage';
  return request({
    url: '/platform/sysBuryingPoint/querySysBuryingPointListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysBuryingPoint = (params) => {
  params.head.transCode = 'saveSysBuryingPoint';
  return request({
    url: '/platform/sysBuryingPoint/saveSysBuryingPoint',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysBuryingPointList = (params) => {
  params.head.transCode = 'saveSysBuryingPointList';
  return request({
    url: '/platform/sysBuryingPoint/saveSysBuryingPointList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysBuryingPoint = (params) => {
  params.head.transCode = 'saveOrUpdateSysBuryingPoint';
  return request({
    url: '/platform/sysBuryingPoint/saveOrUpdateSysBuryingPoint',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysBuryingPointList = (params) => {
  params.head.transCode = 'saveOrUpdateSysBuryingPointList';
  return request({
    url: '/platform/sysBuryingPoint/saveOrUpdateSysBuryingPointList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysBuryingPoint = (params) => {
  params.head.transCode = 'updateSysBuryingPoint';
  return request({
    url: '/platform/sysBuryingPoint/updateSysBuryingPoint',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysBuryingPoint = (params) => {
  params.head.transCode = 'deleteSysBuryingPoint';
  return request({
    url: '/platform/sysBuryingPoint/deleteSysBuryingPoint',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysBuryingPointList = (params) => {
  params.head.transCode = 'deleteSysBuryingPointList';
  return request({
    url: '/platform/sysBuryingPoint/deleteSysBuryingPointList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysBuryingPointExcel = (params) => {
  console.log('params===',params);
  downloadExcel({
    url: '/platform/sysBuryingPoint/excelDownload/exportSysBuryingPointExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
